﻿using System.Web.Mvc;

namespace ManageBanking.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Search", // Route name
                "Admin/{controller}/{action}/{searchcontent}/{typesearch}", // URL with parameters
                new { controller = "Search", action = "SearchUser", searchcontent = UrlParameter.Optional, typesearch = UrlParameter.Optional } // Parameter defaults
            );

            context.MapRoute(
                "page", // Route name
                "Admin/{controller}/{action}/{idusername}/{lockuser}/{page}", // URL with parameters
                new { controller = "ManageUserAdmin", action = "Update", idusername = UrlParameter.Optional, lockuser = UrlParameter.Optional, page = UrlParameter.Optional } // Parameter defaults
            );
        }
    }
}
